package com.linq.cool.beauty.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.linq.cool.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: yqlin
 * @Date: 2021/2/11 00:34
 * @Description: 订单信息表
 * @Version: 1.0.0
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "beauty_order")
public class BeautyOrder extends BaseEntity {
    /**
     * 订单id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.INPUT)
    private Long id;

    /**
     * 客户(会员)id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "member_id")
    private Long memberId;

    /**
     * 订单总金额
     */
    @TableField(value = "total_amount")
    private BigDecimal totalAmount;

    /**
     * 应付金额
     */
    @TableField(value = "pay_amount")
    private BigDecimal payAmount;

    /**
     * 优惠券抵扣金额
     */
    @TableField(value = "coupon_amount")
    private BigDecimal couponAmount;

    /**
     * 订单状态(0:待付款 1:待确认 2:待评价 3:已完成 4:无效订单 5已关闭
     */
    @TableField(value = "`status`")
    private Integer status;

    /**
     * 订单类型(0:正常订单 1:秒杀订单)
     */
    @TableField(value = "`type`")
    private Integer type;

    /**
     * 可以获得积分
     */
    @TableField(value = "integration")
    private BigDecimal integration;

    /**
     * 省
     */
    @TableField(value = "province")
    private String province;

    /**
     * 市
     */
    @TableField(value = "city")
    private String city;

    /**
     * 区
     */
    @TableField(value = "county")
    private String county;

    /**
     * 服务店面id
     */
    @TableField(value = "service_store_id")
    private Long serviceStoreId;

    /**
     * 服务店面名称
     */
    @TableField(value = "service_store_name")
    private String serviceStoreName;

    /**
     * 订单备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 支付时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "payment_time")
    private Date paymentTime;

    /**
     * 评论时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "evaluation_time")
    private Date evaluationTime;

    /**
     * 是否评论(0:否 1:是)
     */
    @TableField(value = "is_evaluation")
    private Integer isEvaluation;

    /**
     * 是否删除(0:未删除 1:已删除)
     */
    @TableLogic
    @TableField(value = "is_deleted")
    private Integer isDeleted;
}